<layout name='Layout/layout_page' />
	
	<ol class="breadcrumb">
		<li><a href="<{:U('Goods/index')}>">商品管理</a></li>
      	<li class="active">添加</li>
    </ol>

	<form id="ajaxForm" action="<{:U('Goods/save')}>" method="post" class="form-horizontal form-validata">
		<div class="form-group">
			<label class="col-md-1 control-label" for="title">名称</label>
			<div class="col-md-11">
				<input type="text"
                class="form-control"
				name="name"
				id="name"
				data-rule-required="true"
				/>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="title">一句话描述</label>
			<div class="col-md-11">
				<input type="text"
                class="form-control"
				name="intr"
				id="intr"
				placeholder="商品简短描述，不要超过50个字"				
				/>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="cid">分类</label>
			<div class="col-md-11">
				<select name="cid" id="cid" class="form-control" data-rule-required="true">
		    	<option value="">==请选择==</option>
		        <volist name="cate" id="vo">
		        <option value="<{$vo['id']}>,<{$vo['path']}>"><php>
		            for($i=0; $i<$vo['count']*2; $i++){
		               echo '&nbsp;&nbsp;';            
		            }
		        </php><{$vo['name']}></option>
		        </volist>
		        </select>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="picname">缩略图</label>
			<div class="col-md-11">
				<img class="thumbPic" id="picname_src" src="<{:STATICS}>/image/image.jpg"/>
				<input type="hidden" name="picname" id="picname" />
				<p class="pic-btn"><input type="button" value="上传" class="btn btn-default btn-sm" onclick="uploadImage( '<{:U('Admin/Upload/singleImage')}>' , 'picname')"/> <input type="button" value="删除图片" class="btn btn-default btn-sm" onclick="delImage('picname')"/></p>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="keyword">属性</label>
			<div class="col-md-11">
				<label class="checkbox-inline">
					<input type="checkbox" name="index" id="index" value="1"> 首页推送
				</label>
				<label class="checkbox-inline">
				  	<input type="checkbox" name="tejia" value="1"> 特价
				</label>
				<label class="checkbox-inline">
				  	<input type="checkbox" name="cuxiao" value="1"> 促销
				</label>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="keyword">状态</label>
			<div class="col-md-11">
				<label class="radio-inline">
					<input type="radio" name="show" value="1" checked="checked"> 销售中
				</label>
				<label class="radio-inline">
					<input type="radio" name="show" value="0"> 下架
				</label>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="from">销售价</label>
			<div class="col-md-2">
				<input type="text"
                class="form-control"
				name="price"
				id="price"
				data-rule-required="true"
				data-rule-number="true"
				/>
			</div>
			<label class="col-md-1 control-label" for="from">参考市场价</label>
			<div class="col-md-2">
				<input type="text"
                class="form-control"
				name="shichang"
				id="shichang"
				data-rule-required="true"
				data-rule-number="true"
				/>
			</div>
		</div>
		<div class="form-group">
			<label class="col-md-1 control-label" for="keyword">初始销量</label>
			<div class="col-md-11">
				<input type="text"
                class="form-control"
				name="sellNumber"
				id="sellNumber"
				value="0" 
				data-rule-required="true"
				data-rule-number="true"
				/>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="sort">排序</label>
			<div class="col-md-11">
				<input type="text"
                class="form-control"
				class="input-small"
				name="sort"
				id="sort"
				value="1"
				data-rule-required="true"
				data-rule-number="true"
				/>
				<p>数字越小越靠前</p>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="keywords">商品介绍</label>
			<div class="col-md-11">
				<textarea name="content" id="container">文章正文</textarea>
				<script type="text/javascript" src="<{:C('UE_DIR')}>/my.config.js"></script>
				<script type="text/javascript" src="<{:C('UE_DIR')}>/ueditor.all.js"></script>
				<script type="text/javascript" src="<{:C('UE_DIR')}>/lang/zh-cn/zh-cn.js"></script>
				<script type="text/javascript">
				var defPath = "<{:C('UPLOAD_PATH')}>";
				window.UEDITOR_CONFIG.imagePath= defPath;  //插入编辑器中图片路径修正
				window.UEDITOR_CONFIG.filePath= defPath; //插入编辑器中文件路径修正
				window.UEDITOR_CONFIG.scrawlPath= defPath; //涂鸦默认路径
				var editor = UE.getEditor('container');
				</script>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="keywords">参数规格</label>
			<div class="col-md-11">
				<textarea name="parm" id="parm">文章正文</textarea>
				<script type="text/javascript">
				var editor = UE.getEditor('parm');
				</script>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="keywords">售后保障</label>
			<div class="col-md-11">
				<textarea name="server" id="server">文章正文</textarea>
				<script type="text/javascript">
				var editor = UE.getEditor('server');
				</script>
			</div>
		</div>
			
		<div class="form-group">
			<div class="col-md-11 col-sm-offset-1">
				<button type="submit" class="btn btn-info">添加</button>
			</div>
		</div>
	</form>
<input type="hidden" id="menu_action" value="goods" />
